package com.zjitc;

import com.zjitc.config.javaConfigDemo2;
import com.zjitc.obj.Teacher;
import com.zjitc.obj.User;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * Create by IntelliJ IDEA
 *
 * @author: jsonor
 * @date-Time: 2018/3/6 15:59
 * @description:
 */
public class App2 {

  public static void main(String[] args) {
    ApplicationContext context = new AnnotationConfigApplicationContext(javaConfigDemo2.class);

    User user = context.getBean("user", User.class);
    System.out.println(user);

    User user2 = context.getBean("user2", User.class);
    System.out.println(user2);

    Teacher teacher = context.getBean("teacher", Teacher.class);
    System.out.println(teacher);

  }
}
